# This script assesses the average number of words a respondent 
# will have to read as part of the experiment
library(readxl)
library(here)
setwd(here())
snip <- read_excel("data/raw/Post-Feedback Snippets V3.xlsx")

sample.lengths <- sapply(strsplit(snip$Snippets, " "), length)

snip$Snippets[sample.lengths>20]
max(sample.lengths)
snip$Snippets[sample.lengths==15]

# sample.lengths[sample.lengths>15] <- 15

sampleWordCounts <- function() {
sum(sample(sample.lengths, 12))
}

test <- rep(NA, 10000)
for(ii in 1:10000) {
  test[ii] <- sampleWordCounts()
}

prop.table(table(test>150))

median(test)

mean(test)
hist(test)

